﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductListModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%if(Model.Products.Count>0){ %>
<div id="product-tabs">
    <div class="tit_bds_canban_other">
        <%=Model.Products[0].ProductCategory != null ? Html.Encode(Model.Products[0].ProductCategory.Name.Trim()) : string.Empty%>
        <%=Model.Products[0].City != null ? "tại&nbsp;" + Html.Encode(Model.Products[0].City.Name) : string.Empty%>
    </div>
    <div class="line"></div>    
    <div class="clear"></div>          
    <div class="list_cate_1 product-detail">
        <ul>
            <% if (Model.Products != null && Model.Products.Count() > 0)
               {
                   foreach (var item in Model.Products)
                   {
            %>
            <li class="line_dot line_vip line_vip3">
                <div class="prd_tt_img">
                    <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Title)%>">
                        <% string imgPath = (item.ImagePath != null && item.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(item.ID, 82, 63, item.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                        <img src="<%=imgPath %>" title="" alt="<%=item.Title %>" width="82" height="63" class="bor_img" />
                    </a>
                </div>
                <div class="tt_txt_tinrao">
                   <h3>
                        <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Title)%>">
                            <%=Html.Encode(item.Title) %>
                        </a>
                        <%--<%=Html.ActionLink(item.Title, "Details", "Product",new{id=item.ID}, null)%> --%>
                   </h3>
                    <div><%=Html.Encode(item.Summary.Length>150? item.Summary.Substring(0,150)+"...":item.Summary) %></div>
                </div>
                <div class="clear"></div>
                <div class="info">
        	        <div style="float: left">Giá: <span class="t_org"><%=item.Cost != null && item.Cost > 0 ? SDT.Lib.Common.Utils.ReadNumber(item.CurrencyID.HasValue && item.CurrencyID.Value == 1 ? (double)item.Cost : (double)item.TotalCost) + "&nbsp;" + item.UnitCost : "Thỏa thuận"%></span>
            	        Diện tích: <span class="t_org"><%=item.Area %>m&sup2;</span>
                        Quận/Huyện: <span class="t_org"><%=Html.Encode(item.District.Name) %>,&nbsp;
                                            <%=Html.Encode(item.City.Name) %></span>
                    </div>
                    <div style="float: right"><%=item.AddDate.Value.ToString("dd/MM/yyyy") %></div>
                    <div class="clear"></div>
                </div>                    
            </li>
            <%}
               }%>
        </ul>
    </div>
    
</div>
<div class="clear">&nbsp;</div>
<%} %>